<?php
/**
 * The main template file.
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query. 
 * E.g., it puts together the home page when no home.php file exists.
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage Twenty_Ten
 * @since Twenty Ten 1.0
 */

get_header(); ?>

		<div id="container">
			<div id="content" role="main">
			
			<div class = "index-cont">
				<div class = "first-cont">
				<div class = "cont-list">
			<?php 
			  // 得到对应分类
			  $catid = 4;
			  $acat = get_category($catid);
				?>
					<div class = "catlh">
						<div class = "catrh">
						<div class="cat-header">
						   <span class = "cat-title left">
							   <h2>
								<a title="<?php echo $acat->cat_name; ?>" href = "<?php echo get_category_link($catid); ?>"><?php echo $acat->cat_name; ?></a>
								</h2>
							</span>
							<span class = "cat-more right" >
								<ul>
									<li>
									<a href = "<?php echo get_category_link($catid); ?>"><?php _e('&raquo; 更多', 'xiufanr');?></a>
									</li>
								</ul>
							</span>
					  </div><!--cat-header-->
					  </div><!--catrh-->
					  </div><!--catlh-->
					  <div class="cat-entry" >	
						<div class = "list-post clear">
						<ul>
						<?php 
						$args=array(
													'cat' => $catid ,  // 分类ID为2
													//'category_name' => 'zaizhishuoshi',   // 
													'posts_per_page' => 8 //显示8篇
													//'paged'=> 1,
														);
								query_posts($args);
								//query_posts("showposts=10&cat=$catid"); 

								if(have_posts()):?>
									<?php while(have_posts()):the_post();?>
									
									<li>
									<span class = "date"><?php the_time('Y-m-d');?></span>
									<span class = "post-title"><a href="<?php the_permalink();?>" title="<?php the_title();?>"><?php the_title();?></a></span>
									</li>								
							<?php endwhile;?>
								<?php else:?>
									<li class="post">
										<?php _e('无相关文章', 'xiufanr');?>
									</li>
							<?php endif;?>
							</ul>
							</div><!--list-post-->
					  </div><!--cat-entry-->
					  <div class = "bg-bottom">
							<div class = "bg-bottom-r"></div>
					  </div>
					  </div><!--cont-list-->
					</div><!--first-cont-->
				<div class = "sec-cont">
					<div class = "cont-list">
						<div class = "bg-top">
							<div class = "bg-top-r"></div>
						</div>
						<div class="cat-entry" >							
					<?php include(TEMPLATEPATH."/templates/huandeng.php");?> 
					</div><!--cat-entry-->
						<div class = "bg-bottom">
							<div class = "bg-bottom-r"></div>
						</div>
					</div><!--cont-list-->
				</div><!--sec-cont-->
				<div class = "clear"></div>
				<div class = "thr-cont">
				<div class = "cont-list">
				<?php 
			  // 对应分类
			  $catid = 7;
			  $acat = get_category($catid);
				?>
					<div class = "catlh">
						<div class = "catrh">
						<div class="cat-header">
						   <span class = "cat-title left">
							   <h2>
								<a title="<?php echo $acat->cat_name; ?>" href = "<?php echo get_category_link($catid); ?>"><?php echo $acat->cat_name; ?></a>
								</h2>
							</span>
							<span class = "cat-more right" >
								<ul>
									<li>
									<a href = "<?php echo get_category_link($catid); ?>"><?php _e('&raquo; 更多', 'xiufanr');?></a>
									</li>
								</ul>
							</span>
					  </div><!--cat-header-->
					  </div><!--catrh-->
					  </div><!--catlh-->
					  <div class="cat-entry" >
						<div class = "list-post clear">
						<ul>
						<?php 
						$args=array(
													'cat' => $catid ,  // 
													//'category_name' => 'zaizhishuoshi',   // 
													'posts_per_page' => 8 //
													//'paged'=> 1,
														);
								query_posts($args);
								//query_posts("showposts=10&cat=$catid"); 

								if(have_posts()):?>
									<?php while(have_posts()):the_post();?>
									
									<li>
									<span class = "date"><?php the_time('Y-m-d');?></span>
									<span class = "post-title"><a href="<?php the_permalink();?>" title="<?php the_title();?>"><?php the_title();?></a></span>
									</li>								
							<?php endwhile;?>
								<?php else:?>
									<li class="post">
										<?php _e('无相关文章', 'xiufanr');?>
									</li>
							<?php endif;?>
							</ul>
							</div><!--list-post-->
					  </div><!--cat-entry-->
						  <div class = "bg-bottom">
								<div class = "bg-bottom-r"></div>
						  </div>
					 </div><!--cont-list-->
				</div><!--thr-cont-->
				<div class = "four-cont">
				<div class = "cont-list">
				<?php 
			  // 对应分类
			  $catid = 5;
			  $acat = get_category($catid);
				?>
					<div class = "catlh">
						<div class = "catrh">
						<div class="cat-header">
						   <span class = "cat-title left">
							   <h2>
								<a title="<?php echo $acat->cat_name; ?>" href = "<?php echo get_category_link($catid); ?>"><?php echo $acat->cat_name; ?></a>
								</h2>
							</span>
							<span class = "cat-more right" >
								<ul>
									<li>
									<a href = "<?php echo get_category_link($catid); ?>"><?php _e('&raquo; 更多', 'xiufanr');?></a>
									</li>
								</ul>
							</span>
					  </div><!--cat-header-->
					  </div><!--catrh-->
					  </div><!--catlh-->
					  <div class="cat-entry" >	
						<div class = "list-post clear">
						<ul>
						<?php 
						$args=array(
													'cat' => $catid ,  // 
													//'category_name' => 'zaizhishuoshi',   // 
													'posts_per_page' => 8 //
													//'paged'=> 1,
														);
								query_posts($args);
								//query_posts("showposts=10&cat=$catid"); 

								if(have_posts()):?>
									<?php while(have_posts()):the_post();?>
									
									<li>
									<span class = "date"><?php the_time('Y-m-d');?></span>
									<span class = "post-title"><a href="<?php the_permalink();?>" title="<?php the_title();?>"><?php the_title();?></a>
									</span>
									</li>								
							<?php endwhile;?>
								<?php else:?>
									<li class="post">
										<?php _e('无相关文章', 'xiufanr');?>
									</li>
							<?php endif;?>
							</ul>
							</div><!--list-post-->
					  </div><!--cat-entry-->
					  <div class = "bg-bottom">
							<div class = "bg-bottom-r"></div>
					  </div>
					</div><!--cont-list-->
				</div><!--four-cont-->
			</div><!--index-cont-->
			<div class = "clear"></div>
			<div class = "entry-list">
				<div class = "etlh">
					<div class = "etrh">
					<div class="et-header">
					<span class = "et-title left">
					<h2><a><?php _e('推荐文章','xiufanr');?></a></h2>
					</span>
					</div><!--et-header-->
					</div><!--etrh-->
					  </div><!--etlh-->
				
			<div class="rec-entry" >	
								
			<?php
			query_posts('showposts=8&offset=1');
			/* Run the loop to output the posts.
			 * If you want to overload this in a child theme then include a file
			 * called loop-index.php and that will be used instead.
			 */
			 get_template_part( 'loop', 'index' );
			?>
			
			</div><!--rec-entry-->
			<div class = "bg-bottom">
							<div class = "bg-bottom-r"></div>
					  </div>
			</div><!--entry-list-->
			</div><!-- #content -->
		</div><!-- #container -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>
